package com.chushouya.controller.order.api;

import com.chushouya.common.constant.ServiceType;
import com.general.framework.core.schema.Response;
import com.chushouya.order.dto.api.order.OrderProcessApiDTO;
import com.chushouya.order.service.api.OrderProcessApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = ServiceType.API + "订单流程接口")
@RestController
@RequestMapping(ServiceType.API + "/order/process")
@Slf4j
public class OrderProcessController {

    @Resource
    private OrderProcessApiService orderProcessApiService;

    @ApiOperation("获取订单流程信息")
    @GetMapping("/detail")
    public Response<OrderProcessApiDTO> getOrderProcess(
            @ApiParam(value = "订单号", required = true) @RequestParam String orderNo) {
        log.info("获取订单流程信息，订单号: {}", orderNo);
        OrderProcessApiDTO result = orderProcessApiService.getOrderProcess(orderNo);
        return Response.success(result);
    }
}
